﻿@using OA.Model.View;
@using OA.Model;
@using X.PagedList;
@using OA.Core.Helper;

@model PageList<SimpleVoucher>
@{
     
     
    
    Layout = "~/Areas/Member/Views/Shared/_Layout.cshtml";

    int customFormID = ViewBag.CustomFormID;
     

}
<div class="layui-tab layui-tab-brief" lay-filter="user">
    <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 5px 0;">
        <form action="" class="layui-form">
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" name="empName" id="empName" class="layui-input empName" placeholder="主办人姓名">
                </div>
                <div class="layui-input-inline">
                    <input type="text" name="startTime" class="layui-input mydate" id="startTime" data-type="date" placeholder="开始时间" autocomplete="off" data-format="yyyy-MM-dd" />
                </div>
                <div class="layui-input-inline">
                    <input type="text" name="endTime" class="layui-input mydate" id="endTime" data-type="date" placeholder="结束时间" autocomplete="off" data-format="yyyy-MM-dd" />
                </div>
            </div>
            <div class="layui-inline">
                <button type="button" class="layui-btn searchButton">搜索</button>
                <button type="button" id="search_btn" class="layui-btn">导出</button>
            </div>
        </form>
    </div>
    <table class="layui-table" lay-data="{url:'GetData?customFormID=@customFormID', cellMinWidth: 80, page: true,limit:15}" id="resultList" lay-filter="resultList">
        <thead>
            <tr>
                <th lay-data="{field:'No', width:140, align:'center'}">编号</th>
                <th lay-data="{ field: 'Title',edit: 'text'}">标题</th>
                <th lay-data="{field:'ApplicationDate', width:180}">申请时间</th>
                <th lay-data="{field:'FinishTime', width:180}">完成时间</th>
                <th lay-data="{field:'SponsorName', width:120}">发起人</th>
                <th lay-data="{field:'Sponsor', width:120}">工号</th>
                <th lay-data="{fixed: 'right', width:120, align:'center', toolbar: '#barDemo'}">操作</th>
            </tr>
        </thead>
    </table>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-primary layui-btn-xs" href="javascript:ShowPage('/Member/Statistic/Show?id={{d.ID}}&customFormID=@customFormID','查看详情')">查看</a> 
    </script>
 
</div>

<script type="text/javascript">
    $("#search_btn").click(function () {
        var empName = $("#empName").val();
        var startTime = $("#startTime").val();
        var endTime = $("#endTime").val();
        var url = "/Member/Statistic/Export?customFormID=@customFormID&empName=" + empName + "&startTime=" + startTime + "&endTime=" + endTime;
        layer.open({
            type: 2,
            title: '数据导出',
            shadeClose: true,
            shade: 0.8,
            area: ['800px', '500px'],
            content: url
        });
    });

</script>
